package com.example.mvpdemo.simple2;

//要持有M层的引用
//要持有V层的引用
//对M层和V层进行关联
public class LoginPresnter2 {

    private LoginModule2 loginModule;
    private LoginView2 loginView;

    public LoginPresnter2(){
        this.loginModule = new LoginModule2(this);
    }

    public void attachView(LoginView2 loginView){
        this.loginView = loginView;
    }
    public void detachView(){
        this.loginView = null;
        //终止请求
    }

    public void login(String username,String password)
    {
        this.loginModule.login(username, password);
    }

    public void loginResult(String ret)
    {
        loginView.onLoginResult(ret);
    }
}
